﻿<phone:PhoneApplicationPage
    x:Class="ChinaUnicom.Views.SettingsPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"    
    mc:Ignorable="d"
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="False"
    toolkit:TiltEffect.IsTiltEnabled="True" 
    d:DesignHeight="728" d:DesignWidth="480">

    <toolkit:TransitionService.NavigationInTransition>
        <toolkit:NavigationInTransition>
            <toolkit:NavigationInTransition.Backward>
                <toolkit:SlideTransition Mode="SlideLeftFadeIn"/>
            </toolkit:NavigationInTransition.Backward>
            <toolkit:NavigationInTransition.Forward>
                <toolkit:SlideTransition Mode="SlideLeftFadeIn"/>
            </toolkit:NavigationInTransition.Forward>
        </toolkit:NavigationInTransition>
    </toolkit:TransitionService.NavigationInTransition>
    <toolkit:TransitionService.NavigationOutTransition>
        <toolkit:NavigationOutTransition>
            <toolkit:NavigationOutTransition.Backward>
                <toolkit:SlideTransition Mode="SlideLeftFadeOut"/>
            </toolkit:NavigationOutTransition.Backward>
            <toolkit:NavigationOutTransition.Forward>
                <toolkit:SlideTransition Mode="SlideLeftFadeOut"/>
            </toolkit:NavigationOutTransition.Forward>
        </toolkit:NavigationOutTransition>
    </toolkit:TransitionService.NavigationOutTransition>

    <phone:PhoneApplicationPage.Resources>

        <Style x:Key="HeadlineStyle" TargetType="TextBlock">
            <Setter Property="FontSize" Value="32"/>
        </Style>
        <Style x:Key="StatementStyle" TargetType="TextBlock">
            <Setter Property="FontSize" Value="20"/>
            <Setter Property="Foreground" Value="{StaticResource PhoneSubtleBrush}"/>
        </Style>

    </phone:PhoneApplicationPage.Resources>

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0" >
            <Rectangle Style="{StaticResource PageTopRectangleStyle}"/>
            <Border Style="{StaticResource PageTopBorderStyle}">
                <TextBlock Text="联通助手" Style="{StaticResource PageTopTextStyle}"/>
            </Border>
        </StackPanel>
        <!--Pivot Control-->
        <controls:Pivot x:Name="ContentContainer" Grid.Row="1">
            <!--Pivot item one-->
            <controls:PivotItem Header="设置">
                <ScrollViewer>
                    <StackPanel Margin="12 0">
                        
                        <Button Template="{StaticResource SampleButtonTemplate}" 
                                Command="{Binding LogoutCommand}"
                                Visibility="{Binding AuthStateVisibility}" 
                                Margin="0, 0, 0, 30">
                            <StackPanel>
                                <TextBlock Text="已登录" Style="{StaticResource HeadlineStyle}"/>
                                <TextBlock Text="{Binding Mobile}" 
                                           Style="{StaticResource StatementStyle}"/>
                            </StackPanel>
                        </Button>

                        <Button Template="{StaticResource SampleButtonTemplate}" 
                                Command="{Binding TrafficSettingsCommand}"
                                Margin="0, 0, 0, 30">
                            <StackPanel>
                                <TextBlock Text="流量统计" Style="{StaticResource HeadlineStyle}"/>
                                <TextBlock Text="{Binding TrafficLength, Converter={StaticResource trafficConverter}}" 
                                           Style="{StaticResource StatementStyle}"/>
                            </StackPanel>
                        </Button>

                        <Button Template="{StaticResource SampleButtonTemplate}" 
                                Command="{Binding ThemeSettingsCommand}"
                                Margin="0, 0, 0, 30">
                            <StackPanel>
                                <TextBlock Text="主题" Style="{StaticResource HeadlineStyle}"/>
                                <TextBlock Text="{Binding Theme,Converter={StaticResource themeConverter}}" 
                                           Style="{StaticResource StatementStyle}"/>
                            </StackPanel>
                        </Button>
                        
                    </StackPanel>
                </ScrollViewer>
            </controls:PivotItem>

            <!--Pivot item two-->
            <controls:PivotItem Header="关于">
                <ScrollViewer>
                    <StackPanel>
                        <RichTextBox>
                            <Paragraph FontWeight="Bold" >
                                <Run Text="{Binding Title}" FontSize="32" Foreground="{StaticResource ThemeLogoBrush}"/>
                                <Run Text=" V"/>
                                <Run Text="{Binding Version}"/>
                                <LineBreak/>
                                <Run Text="{Binding Copyright}"/>
                            </Paragraph>
                            <Paragraph></Paragraph>
                            <Paragraph FontFamily="宋体">
                                <Run Text="Windows Phone 联通助手 是一款方便联通3G用户查询套餐、话费等功能的应用，具有鲜明的主题、清晰明了的UI设计、简单流畅的操作体验。联通助手能够让你轻松从10010.com获取实时、准确的数据。"/>
                                <LineBreak />
                                <Run Text=" * 这是一个基于MIT的开源项目，喜欢的朋友可以到Codeplex网站"/>
                                <Hyperlink NavigateUri="http://chinauincom.codeplex.com/" Foreground="{StaticResource PhoneAccentBrush}" TargetName="_blank">下载</Hyperlink>
                                <Run Text="源码。"/>
                            </Paragraph>
                            <Paragraph></Paragraph>
                            <Paragraph>
                                <Bold># 1.5</Bold>
                                <LineBreak/>
                                <Run Text="1. 新增历史账单查询功能"/>
                                <LineBreak/>
                                <Run Text="2. 新增积分查询功能"/>
                                <LineBreak/>
                                <Run Text="3. 新增流量统计功能"/>
                                <LineBreak/>
                                <Run Text="4. 增加列表下拉刷新数据的刷新体验"/>
                                <LineBreak/>
                                <Run Text="5. 新增 Windows Phone 8 支持"/>
                                <LineBreak/>
                                <Run Text="6. * 修复不能自动登录超时的问题"/>
                                <LineBreak/>
                                <Run Text="7. * 修正自动刷新功能"/>
                            </Paragraph>
                            <Paragraph></Paragraph>
                            <Paragraph>
                                <Bold># 1.0</Bold>
                                <LineBreak/>
                                <Run Text="1. 套餐余量查询功能"/>
                                <LineBreak/>
                                <Run Text="2. 当月话费查询功能"/>
                                <LineBreak/>
                                <Run Text="3. 我的信息查询功能"/>
                            </Paragraph>
                            <Paragraph></Paragraph>
                        </RichTextBox>
                    </StackPanel>
                </ScrollViewer>
            </controls:PivotItem>
        </controls:Pivot>
    </Grid>

    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton IconUri="/Themes/Images/back.png" Text="返回" Click="OnBackClick" />
            <shell:ApplicationBarIconButton IconUri="/Themes/Images/favs.png" Text="我喜欢" Click="OnReviewClick" />
            <shell:ApplicationBarIconButton IconUri="/Themes/Images/share.png" Text="分享" Click="OnShareClick" />
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

</phone:PhoneApplicationPage>